/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author dvasquez
 */
@Entity
@Table(name = "rupturaMoldes")
@NamedQueries({@NamedQuery(name = "RupturaMoldes.findAll", query = "SELECT r FROM RupturaMoldes r"), @NamedQuery(name = "RupturaMoldes.findByCubo", query = "SELECT r FROM RupturaMoldes r WHERE r.rupturaMoldesPK.cubo = :cubo"), @NamedQuery(name = "RupturaMoldes.findByDias", query = "SELECT r FROM RupturaMoldes r WHERE r.rupturaMoldesPK.dias = :dias"), @NamedQuery(name = "RupturaMoldes.findById", query = "SELECT r FROM RupturaMoldes r WHERE r.rupturaMoldesPK.id = :id")})
public class RupturaMoldes implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected RupturaMoldesPK rupturaMoldesPK;

    public RupturaMoldes() {
    }

    public RupturaMoldes(RupturaMoldesPK rupturaMoldesPK) {
        this.rupturaMoldesPK = rupturaMoldesPK;
    }

    public RupturaMoldes(int cubo, int dias, int id) {
        this.rupturaMoldesPK = new RupturaMoldesPK(cubo, dias, id);
    }

    public RupturaMoldesPK getRupturaMoldesPK() {
        return rupturaMoldesPK;
    }

    public void setRupturaMoldesPK(RupturaMoldesPK rupturaMoldesPK) {
        this.rupturaMoldesPK = rupturaMoldesPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (rupturaMoldesPK != null ? rupturaMoldesPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RupturaMoldes)) {
            return false;
        }
        RupturaMoldes other = (RupturaMoldes) object;
        if ((this.rupturaMoldesPK == null && other.rupturaMoldesPK != null) || (this.rupturaMoldesPK != null && !this.rupturaMoldesPK.equals(other.rupturaMoldesPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.RupturaMoldes[rupturaMoldesPK=" + rupturaMoldesPK + "]";
    }

}
